home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 39
/
Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso
/
Aminet
/
biz
/
swood
/
FW_AllInOne.lha
/
Makros
/
ObjektManager
< prev
next >
Wrap
Text File
|
1998-01-18
|
9KB
|
385 lines
/* Optimized with RexxOpt 1.7 */
Parse ARG FW
IF ~show('L','tritonrexx.library') then
IF ~ADDLIB('tritonrexx.library',10,-30,0) THEN;DO
'ShowMessage 2 1 "Fehler...." "Benötige Libs:tritonrexx.library" "" "Abbruch" "" ""'
exit
END
R='0A'X
If FW='' then;do
Address='FinalW'
Options results
STATUS PORTNAME
FW=result
End
address(FW)
SIGNAL ON syntax
If open('Hilfe',"S:FW_Paket.prefs","R") then;do
HilfeVerz=readln('Hilfe')
Call Close('Hilfe')
End
else HilfeVerz=''
Anzeige.0=4
Anzeige.1=" Ich durchsuche das Dokument"
Anzeige.2=" nach vorhandenen Objekten..."
Anzeige.3=""
Anzeige.4=" Bitte warten..."
apptags='TRCA_Name ObjektManager',
'TRCA_LongName "Übersicht der Objekte"',
'TRCA_Info "für FinalWriter"',
'TRCA_Version "1.0 registered"',
'TRCA_Release "3"',
'TRCA_Date "09.01.98"',
'TAG_END'
windowtags=WindowID(1),
WindowPosition('TRWP_CENTERDISPLAY'),
WindowFlags('TRWF_NOMINTEXTWIDTH'),
PubScreenName('FinalWriterPubScreen'),
WindowTitle("ObjektManager"),
BeginMenu('Projekt'),
MenuItem('Q_Verlassen...',104),
BeginMenu('?'),
MenuItem('?_Info',101),
MenuItem('H_Hilfe',103),
'VertGroupEAC',
'SpaceS',
'HorizGroupEAC',
'Space',
TextN("Abschnitt S. ID - Typ Abbildungstitel "),
'Space',
'EndGroup',
'HorizGroupEAC',
'Space',
FWListSS(Anzeige,1,0,0) 'TRAT_Flags TRLV_ShowSelected',
'Space',
'EndGroup',
'HorizGroupEAC',
'Space',
Button('Ab_schnitte',5),
'SpaceS',
Button('_Alle',6),
'Space',
'EndGroup',
'SpaceS',
'HorizSeparator',
'SpaceS',
'HorizGroupEAC',
'Space',
Button('_Zeigen',2),
'SpaceS',
Button('_Bearbeiten',3),
'SpaceS',
Button('_Löschen',4),
'Space',
'EndGroup',
'SpaceS',
'EndGroup',
'EndProject'
app=TR_CREATEAPP('TRCA_Name Graphix')
IF app~='00000000'x THEN;DO
window1=TR_OPENPROJECT(app,windowtags)
IF window1 ~='00000000'x THEN;DO
ende=0
GetSectionSetup Name
FirstAbschnitt=Result
Status ParaPos
FirstPos=Result
Call AbsErmitteln
alle=1
i=0
Do a=1 to Menge
GoToSection Abschnitte.a
GraphicTool
Abs=Abschnitte.a
Call Look
end
GoToSection FirstAbschnitt
MoveToLine FirstPos
Call TR_SETATTRIBUTE(window1,1,'TROB_LISTVIEW',Anzeige)
DO WHILE ~ende
CALL TR_WAIT(app,'')
DO WHILE TR_HANDLEMSG(app,'event')
IF event.trm_class='TRMS_NEWVALUE' THEN;DO
SELECT
WHEN event.trm_id=1 THEN;Do
Zeile=event.trm_data+1
Call EnDis
END
OTHERWISE
NOP
END
END
IF event.trm_class='TRMS_ACTION' THEN;DO
SELECT
WHEN event.trm_id=2 THEN;Do
Zeile=TR_GETATTRIBUTE(window1,1,'TRAT_VALUE')+1
if anzeige.0=0 then leave
GetDocItemPrefs Decimal
Punkt=Result
If Punkt="Comma" then DocItemPrefs Decimal Period
GotoSection Absch.Zeile
GraphicTool
Call Selectos
GetObjectCoords ID.Zeile
Parse Var Result Page links oben .
NewFrame Page 1 1 2
Type " "
Backspace
NewFrame Page links oben+1 2
Type " "
Backspace
SelectObject ID.Zeile
If Punkt="Comma" then DocItemPrefs Decimal Comma
END
WHEN event.trm_id=3 THEN;Do
Zeile=TR_GETATTRIBUTE(window1,1,'TRAT_VALUE')+1
if anzeige.0=0 then leave
GotoSection Absch.Zeile
GraphicTool
Call Selectos
If Typ.Zeile=1 then ImportPrefs PROMPT
If (Typ.Zeile=2|Typ.Zeile=3) then LinePrefs PROMPT
If (Typ.Zeile=4|Typ.Zeile=5) then BoxPrefs PROMPT
If (Typ.Zeile=6|Typ.Zeile=9) then OvalPrefs PROMPT
If Typ.Zeile=7 then TextBlockPrefs PROMPT
If Typ.Zeile=10 then ShapePrefs PROMPT
If Typ.Zeile=11 then TablePrefs PROMPT
If Typ.Zeile=12 then FramePrefs PROMPT
EditBody
END
WHEN event.trm_id=4 THEN;Do
Zeile=TR_GETATTRIBUTE(window1,1,'TRAT_VALUE')+1
if anzeige.0=0 then leave
GotoSection Absch.Zeile
GraphicTool
Call Selectos
DeleteObject ID.Zeile
EditBody
Do z=Zeile to Anzeige.0-1
zz=z+1
Anzeige.z=Anzeige.zz
ID.z=ID.zz
Typ.z=Typ.zz
Seite.z=Seite.zz
Name.z=Name.zz
Art.z=Art.zz
Absch.z=Absch.zz
End
z=z-1
Anzeige.0=z
ID.0=z
Typ.0=z
Seite.0=z
Name.0=z
Art.0=z
Absch.0=z
i=0
Call TR_SETATTRIBUTE(window1,1,'TROB_LISTVIEW',Anzeige)
Zeile=TR_GETATTRIBUTE(window1,1,'TRAT_VALUE')+1
Call EnDis
END
WHEN event.trm_id=5 THEN;Do
Call AbsErmitteln
Call Fenster
alle=0
GoToSection Abschnitte.auswahl
GraphicTool
Abs=Abschnitte.auswahl
i=0
Call Look
Call TR_SETATTRIBUTE(window1,1,'TROB_LISTVIEW',Anzeige)
Zeile=TR_GETATTRIBUTE(window1,1,'TRAT_VALUE')+1
Call EnDis
END
WHEN event.trm_id=6 THEN;Do
Call AbsErmitteln
alle=1
i=0
Do a=1 to Menge
GoToSection Abschnitte.a
GraphicTool
Abs=Abschnitte.a
Call Look
end
Call TR_SETATTRIBUTE(window1,1,'TROB_LISTVIEW',Anzeige)
Zeile=TR_GETATTRIBUTE(window1,1,'TRAT_VALUE')+1
Call EnDis
END
WHEN event.trm_id=101 THEN Call rtezrequest("Aus dem Makro-Paket:"||R||R||"ObjektManager V1.0 für FW"||R||"© 1998 Heiko Schröder","Danke für Ihre Registrierung.","Info","rt_pubscrname=FinalWriterPubScreen")
WHEN event.trm_id=103 THEN address command "run Multiview PUBSCREEN=FinalWriterPubScreen "||d2c(34)||HilfeVerz||"ObjektManager.guide"||d2c(34)
WHEN event.trm_id=104 THEN ende=1
OTHERWISE NOP
END
END
IF event.trm_class='TRMS_CLOSEWINDOW' THEN ende=1
END
END
CALL TR_CLOSEPROJECT(window1)
END
CALL TR_DELETEAPP(app)
END
Exit
EnDis:
If Typ.Zeile=8 then Call TR_SETATTRIBUTE(window1,3,'TRAT_DISABLED',1)
else Call TR_SETATTRIBUTE(window1,3,'TRAT_DISABLED',0)
Return
Look:
u=0
GraphicTool
Anzeige.0=i;ID.0=i;Typ.0=i;Seite.0=i;Name.0=i;Art.0=i;Absch.0=i
FirstObject
ObjectID=result
Do While ObjectID~=0
Call Grafiken
NextObject ObjectID
ObjectID=result
end
GetPageSetup Pages
Vorlage=result
Do u=1 to 2
If u=1 then EditRightMaster
If u=2 then;do
If Vorlage="LeftRight" then EditLeftMaster
else leave
End
FirstObject
ObjectID=result
Do While ObjectID~=0
Call Grafiken
NextObject ObjectID
ObjectID=result
end
end
EditBody
RETURN
Selectos:
SelectObject ID.Zeile
If RC=10 then;do
EditRightMaster
SelectObject ID.Zeile
If (RC=10&Vorlage="LeftRight") then;do
EditLeftMaster
SelectObject ID.Zeile
end
end
Return
Grafiken:
i=i+1
Anzeige.0=i;ID.0=i;Typ.0=i;Seite.0=i;Name.0=i;Art.0=i;Absch.0=i
ID.i=ObjectID
GetObjectTitle ObjectID
Name.i=result
GetObjectType ObjectID
Typ.i=result
Select
When Typ.i=1 then Art.i="Grafik"
When Typ.i=2 then Art.i="Linie"
When Typ.i=3 then Art.i="Pfeil"
When Typ.i=4 then Art.i="Rechteck"
When Typ.i=5 then Art.i="abg. Rechteck"
When Typ.i=6 then Art.i="Oval"
When Typ.i=7 then Art.i="Textblock"
When Typ.i=8 then Art.i="Gruppierung"
When Typ.i=9 then Art.i="Kreisbogen"
When Typ.i=10 then Art.i="Umrißobjekt"
When Typ.i=11 then Art.i="Tabelle"
When Typ.i=12 then Art.i="Textrahmen"
Otherwise NOP
end
GetObjectCoords ObjectID
Parse var result Seite .
Seite.i=Seite
If u=1 then Seite.i="rSV"
If u=2 then Seite.i="lSV"
Absch.i=Abs
IDe.i=ID.i
If Length(IDe.i)=1 then IDe.i=" "||IDe.i
If alle=1 then;do
abo=Abschnitte.a
If Length(abo)>11 then abo=Left(abo,11)
Anzeige.i=abo||copies(" ",12-Length(abo))||" "||Seite.i||copies(" ",4-Length(Seite.i))||" "||IDe.i||"-"||Art.i||copies(" ",13-Length(Art.i))||Name.i
end
else;do
abo=Abschnitte.auswahl
If Length(abo)>11 then abo=Left(abo,11)
Anzeige.i=abo||copies(" ",12-Length(abo))||" "||Seite.i||copies(" ",4-Length(Seite.i))||" "||IDe.i||"-"||Art.i||copies(" ",13-Length(Art.i))||Name.i
end
RETURN
Fenster:
windowtags2=WindowID(2),
WindowPosition('TRWP_CENTERDISPLAY'),
WindowFlags('TRWF_NOCLOSEGADGET|TRWF_ACTIVATESTRGAD|TRWF_NOZIPGADGET'),
PubScreenName('FinalWriterPubScreen'),
WindowTitle("Abschnitt auswählen"),
'VertGroupA',
'SpaceS',
'HorizGroupA',
'SpaceS',
FWListSelC(Abschnitte,1,0) 'TRAT_Flags TRLV_ShowSelected',
'SpaceS',
'EndGroup',
'SpaceS',
'EndGroup',
'EndProject'
app2=TR_CREATEAPP('TRCA_Name Abschnitt')
IF app2~='00000000'x THEN;DO
window2=TR_OPENPROJECT(app2,windowtags2)
IF window2 ~='00000000'x THEN;DO
ende=0
DO WHILE ~ende
CALL TR_WAIT(app2,'')
DO WHILE TR_HANDLEMSG(app2,'event')
IF event.trm_class='TRMS_NEWVALUE' THEN;DO
SELECT
WHEN event.trm_id=1 THEN;do
auswahl=TR_GETATTRIBUTE(window2,1,'TRAT_VALUE')+1
ende=1
END
OTHERWISE
NOP
END
END
IF event.trm_class='TRMS_CLOSEWINDOW' THEN ende=1
END
END
CALL TR_CLOSEPROJECT(window2)
END
CALL TR_DELETEAPP(app2)
END
ende=0
RETURN
AbsErmitteln:
i=0
GetSectionList "ð"
Abschnitt=result
Do ForEver
pos=pos("ð",Abschnitt)
i=i+1
Abschnitte.0=i
If pos=0 then leave
Abschnitte.i=Left(Abschnitt,pos-1)
Abschnitt=Delstr(Abschnitt,1,pos)
end
Abschnitte.i=Abschnitt
Menge=i
RETURN
syntax:
CALL quit('Fehler' rc 'in Zeile' sigl '-' ERRORTEXT(rc),20)
quit:
PARSE ARG message,rcode
IF app ~='00000000'x THEN;DO
IF message ~='' THEN
address command 'RequestChoice title=Achtung body="'message'" Gadgets=Okay PubScreen=FinalWriterPubScreen >NIL:'
CALL TR_DELETEAPP(app)
END
ELSE;DO
IF message ~='' THEN;DO
SAY message
SAY
OPTIONS PROMPT 'Bitte <RETURN> drücken'
PULL taste
END
END
address command "flushtrx all"
EXIT(rcode)